Skip to content

mysql: various test fixes#4305

Open
mmatczuk wants to merge 5 commits intomainfrom
mmt/mysql-fixes-v2
Open

mysql: various test fixes#4305
mmatczuk wants to merge 5 commits intomainfrom
mmt/mysql-fixes-v2

Conversation

@mmatczuk
Copy link
Copy Markdown
Contributor

Commits

  • check shutdown signal in onMessage to prevent deadlock
  • ignore expected context.Canceled from stream Run in test goroutine
  • ignore expected context.Canceled from stream Run in DDL test goroutine
  • tolerate context.Canceled in resume test stream goroutine
  • tolerate context.Canceled in composite primary keys test stream goroutine

Jira

  • CON-432
  • CON-434
  • CON-444

onMessage blocks on rawMessageEvents channel send with no shutdown
check. During shutdown, readMessages stops consuming the channel,
causing the canal handler goroutine to deadlock. canal.Close() then
waits for handler goroutines indefinitely. Add a select on
shutSig.SoftStopChan() so onMessage unblocks during shutdown, matching
the pattern already used in readSnapshot.

Fixes CON-432
…tine

The goroutine running streamOut.Run(t.Context()) in TestIntegrationMySQLSnapshotAndCDC
asserted require.NoError on the result. When StopWithin returns and the test exits,
t.Context() is canceled, causing Run to return context.Canceled. This is expected
behavior — the CDC stream shuts down cleanly. Use _ = to discard the error, matching
the pattern applied in the PostgreSQL tests.

Fixes CON-432
…oroutine

Same fix as 48917d85e applied to TestIntegrationMySQLCDCSchemaInvalidationOnDDL.
The goroutine running streamOut.Run(t.Context()) asserted require.NoError on the
result. When the stream shuts down after DDL-triggered re-sync, Run returns
context.Canceled which is expected behavior.

Fixes CON-434
When StopWithin cancels the resume stream context, Run returns
context.Canceled. Match the pattern used in other CDC integration tests
so the goroutine does not fail the test on expected shutdown.

Fixes CON-444
…m goroutine

When StopWithin cancels the stream context, Run returns context.Canceled.
Match the pattern used in other CDC integration tests so the goroutine
does not fail the test on expected shutdown.

Fixes CON-432
@claude
Copy link
Copy Markdown

claude Bot commented Apr 20, 2026

Commits
LGTM

Review
Bug fix adds a select with shutSig.SoftStopChan() in onMessage to unblock the canal handler during shutdown, plus four integration-test goroutines updated to tolerate expected context.Canceled from stream.Run. Fix is correct and matches patterns used elsewhere.

LGTM

This was referenced Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants